#{extends 'layout.html'/}
#{set title:messages.get('crud.list.title', '会员管理') /}

<script type="text/javascript" src="/public/javascripts/jquery-1.6.4.min.js"></script>
<link rel="stylesheet" href="/public/stylesheets/alert.css" type="text/css" />
<script type="text/javascript" src="/public/javascripts/adu.alert.js"></script>
<style type="text/css">
	#crudListTable table {border:1px solid #ccc; }
	#crudListTable table tbody th { !important width: 100px; border-right:1px solid #ccc;}
	#crudListTable table tbody tr td { overflow: hidden;}
</style>

<div id="crudList" class="${type.name}">
    <div id="crudListSearch">
        <form enctype="application/x-www-form-urlencoded" accept-charset="utf-8" method="get" action="/members/list">
			<input type="text" value="" name="search">
			<input type="submit" value="搜索">
		</form>
		<font style="color:red">注 ： *  点击借阅卡余额，修改借阅卡金额</font>
    </div>

    <div id="crudListTable">
         #{crud.table fields:['id','lecnum','metid','money','graid','memnum','memtime','memname','memjifen','memstate','mememail','操作']}
         #{crud.custom 'id'}
         	${object.id}
         #{/crud.custom}
         #{crud.custom 'money'}
         	<a  mm = "${service.LendCardService.getmoney(object.lecnum)?.lecmone}" href ="javascript:dd(${service.LendCardService.getmoney(object.lecnum)?.lecmone},'${object.lecnum}')" >${service.LendCardService.getmoney(object.lecnum)?.lecmone}</a>
         #{/crud.custom}
         #{crud.custom '操作'}
	                    #{form @delete(object._key())}
	                    	<input type="submit" value="删除" />
	                    #{/form}
        #{/crud.custom}
        #{/crud.table}
    </div>

    <div id="crudListPagination">
        #{crud.pagination /}
    </div>

    <p style="margin-right:100px;" id="crudListAdd">
        <a href="/controllers/MemberRegAction.bgaddmember">添加</a>
    </p>
    <p></p>
    <script type="text/javascript">
    	function dd (str,num){
    	  var  $div = "" ;
    	       $div="<div>借阅卡金额：<input id='moneyt' type='text' value='"+str+"' />元<input style='margin-left:15px;' id='updatemoney' type='button' value='修改' /><input id='lnum' type='hidden' value='"+num+"' /></div>" 
			aduBox($div,"<font color='red'>修改借阅卡金额</font>");
			$("#updatemoney").click(function(){
				var moneyt = $("#moneyt").val();
				var lnum = $("#lnum").val();
				if(moneyt == ""){
					aduAlert("借阅卡金额不能为空！","提示");
					return false;
				}
				$.ajax({
					type:'post',
					url :'/controllers/LendCardFAction.savemoney',
					data:({'moneyt':$("#moneyt").val(),'lnum':$("#lnum").val()}),
					dataType:'html',
					success:function(e){
						if(e == "1"){
							aduAlert("修改金额成功！","提示",function(){
								window.location.href = "/controllers/Members.list";
							});
						}
						if(e == "0"){
							aduAlert("修改金额失败！","提示");
							return false;
						}
					}
				});
			});
		}
    </script>
</div>
